<%@ include file="/WEB-INF/common/taglibs.jsp"%>
<% response.setContentType("text/html; charset=utf-8");%>
<% response.setHeader("Cache-Control", "no-cache");%>
<% response.setHeader("Pragma", "no-cache");%>
<% if (request.getAttribute("struts.valueStack") != null) { %>
<%-- ActionError Messages - usually set in Actions --%>
<s:if test="hasActionErrors()">
    <s:iterator value="actionErrors">
		<s:property/>
	</s:iterator>
</s:if>
<%-- FieldError Messages - usually set by validation rules --%>
<s:if test="hasFieldErrors()">
		<s:iterator value="fieldErrors">
		    <s:iterator value="value">
		       <s:property/>
		    </s:iterator>
		</s:iterator>
</s:if>
<s:if test='hasActionMessages()'>
		<s:iterator value="actionMessages" status="rows">
			<s:property escape="false"/>
		</s:iterator>
</s:if>
<% } %>
<%-- Success Messages --%>
<c:if test="${not empty messages}">
        <c:forEach var="msg" items="${messages}">
            <c:out value="${msg}"/>
       	</c:forEach>
	<c:remove var="messages" scope="session"/>		                    
</c:if>
<%-- Error Messages (on JSPs, not through Struts --%>
<c:if test="${not empty errors}">
        <c:forEach var="error" items="${errors}">
            <c:out value="${error}"/>
        </c:forEach>
    <c:remove var="errors" scope="session"/>
</c:if>